package com.pinyoumei.app.adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.pinyoumei.app.R;
import com.pinyoumei.app.bean.GoodsTypeBean;
import com.pinyoumei.app.bean.SectionBean;

import java.util.List;

/**
 * Created by Administrator on 2021-08-09.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2021-08-09        Administrator             新增Person类
 * 2021-08-09        Administrator             增加sex属性
 */
public class GoodsTypeAdapter extends BaseQuickAdapter<GoodsTypeBean.GoodsTypeDto, BaseViewHolder> {
    private Context context;
    public GoodsTypeAdapter(Context context, int layoutResId, @Nullable List<GoodsTypeBean.GoodsTypeDto> data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsTypeBean.GoodsTypeDto item) {

        helper.setText(R.id.top_item_txt,item.getType_name());

        if (item.isSelect()){
            helper.setVisible(R.id.top_item_line,true);
            helper.setTextColor(R.id.top_item_txt,context.getResources().getColor(R.color.color_018d47));
        }else{
            helper.setVisible(R.id.top_item_line,false);
            helper.setTextColor(R.id.top_item_txt,context.getResources().getColor(R.color.black));
        }
    }




}
